import { createRef } from "react";
import { Navigate, Outlet } from "react-router-dom";
import { SuspenseComponent } from "@/utils/MyFun";

const log = {
  name: "日志管理",
  path: "/log",
  element: <Outlet />,
  nodeRef: createRef(null),
  isHidden: false,
  meta: {
    title: "日志管理",
    icon: "material-symbols:receipt-long-outline-rounded",
    order: 6,
    keepAlive: true,
  },
  children: [
    {
      path: "/log",
      element: <Navigate to="/log/operation" />,
      nodeRef: createRef(null),
      redirect: true,
    },
    {
      name: "操作日志",
      path: "operation",
      element: SuspenseComponent("/log/operation"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "操作日志",
        icon: "mdi:book-open-page-variant-outline",
        keepAlive: true,
        order: 1,
      },
    },
    {
      name: "登录日志",
      path: "login",
      element: SuspenseComponent("/log/login"),
      nodeRef: createRef(null),
      isHidden: false,
      meta: {
        title: "登录日志",
        icon: "material-symbols:login",
        keepAlive: true,
        order: 2,
      },
    },
  ],
};

export default log;
